<template>
    <div class="user-bar">
        <a class="logo" @click="onLogoClick"></a>
        <h6>用户{{mobile}}</h6>
        <button class="btn" @click="onLogout">切换用户</button>
    </div>
</template>

<script>
import alert from '@/components/alert'

export default {
    props: {
        mobile: {
            type: String
        },
        logoClick: {
            type: Function
        }
    },
    methods: {
    	onLogout() {
            alert.show({
                desc: '确定要切换用户吗？',
                btnTextN: '取消',
                btnTextY: '切换用户',
                callbackY: () => {
                    this.$router.push('/login')
                },
                callbackN: () => {
                    
                }
            })
    	},
        onLogoClick() {
            this.logoClick && this.logoClick()
        }
    }
}
</script>

<style scoped lang="scss">
	@import "./style"
</style>